<?php
include_once '../inc/config.inc.php';
include_once '../inc/mysqli.inc.php';
include_once '../inc/tool.inc.php';
//var_dump($_SERVER); exit();
if(isset($_POST['submit'])){
    $link=connect();
    $cheekflag='add';
include_once 'inc/checkinfo.inc.php';
    $query="insert into fatherModule(moduleName,sort) values('{$_POST['moduleName']}',{$_POST['sort']})";
    $result=execute($link,$query);
    if(mysqli_affected_rows($link)){
        skip('fatherModule.php','ok','添加成功！');
    }
    else{
        skip("$_SERVER[REQUEST_URI]",'error','添加失败，请重试！ ');
    }
}

?>
<?php
$template='添加父板块';
include_once 'inc/header.inc.php';
?>
 <div id="main">
        <div class="intro"><?php echo $template ?></div>  
        <form method="post">   
            <table class="au"> 
                <tr>
                    <td>板块名称</td>
                    <td><input type="text" name="moduleName"></td>
                    <td><span>* 板块名称不得为空，最大不超过40个字符</span></td>
                </tr>
                <tr>
                    <td>排&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;序</td>
                    <td><input type="text" value="0" name="sort"></td>
                    <td><span>* 填写一个数字</span> </td>
                </tr>
            </table>
            <input type="submit" name="submit" value="添加" class="nsubmit" />
        </form>
    </div>

<?php
    include_once 'inc/footer.inc.php';
?>